﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>html VS replaceWith</title>
</head>
<body>
    <div id="mydiv">Hello World</div>
</body>
</html>
<script src="Scripts/jquery-2.1.4.js"></script>
<script language="javascript">
    $(function () {
        //$('#mydiv').html('By World');
        //$('#mydiv').replaceWith('By World');
        //$('#mydiv').text('By World');
    });

    //So html() replaces the contents of the element,
    //while replaceWith() replaces the actual element.
</script>